<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <title>查询公司人员信息</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>   
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script src="${ctxStatic}/js/style.js"></script>
 	<script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript">

		// 检索按钮实装方法
		function searchListForm() {
			var sName = $("#ognizationName").val();	
			var sDutyName = $("#searchDutyId").val();	
			var sRoleName = $("#searchRoleId").val();	
			var sGroupName = $("#searchGroupId").val();	
			var sFirstName = $("#comUserName").val();	
			var sMobile = $("#mobile").val();
			$("#activity_pane").showLoading();
			$.post("${ctx}/companyuser/message/searchList?ognizationName="+sName + "&searchDutyId="+sDutyName + "&searchRoleId="+sRoleName + "&searchGroupId="+sGroupName + "&comUserName="+sFirstName + "&mobile="+sMobile, "", function(result) {
				var listHtml = result["companyUser"];
				var pageHtml = result["page"];
				$("#listHtml").html(listHtml);
				$("#paging").html(pageHtml);
				$("#activity_pane").hideLoading();
			}, 'json');
		} 
		//重置
		function clean() {
			$("input").val("");
			$('#searchDutyId').val('');
	        $("#searchRoleId").val('');
	        $("#searchGroupId").val('');
	        searchListForm();
		}
    </script>
</head>
<body>
	<div class="listArea" id="activity_pane" >
		<form id="searchForm" name="searchForm" method="post">
			<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
			<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
			<div class="listBg" >
				<div class="searchArea clearfix">
					<div class="searchLeft clearfix">
						<div class="searchInp clearfix">
	                	<!-- 员工名 -->
	                    <p><spring:message code="CompanyUser_Name" /></p>
	                    <input class="w-customer"  id="comUserName"  name="comUserName" >   
	                </div>
						
				    <div class="searchInp clearfix">
	                    <p><spring:message code="CompanyUser_DutyAll" /></p>
	                     <select id="searchDutyId"  name="searchDutyId" style="width:100px">
	                    <option value="" selected = "selected"><spring:message code="CompanyUser_pleaseChoose"/></option>
	                    <c:forEach items="${companyUserTemp.userList}" var="company" varStatus="status">
	                       <option value="${company.dutyId}" >${company.dutyName} </option>
	                     </c:forEach>
	                    </select> 
	                </div>
                
	                <div class="searchInp clearfix">
	                    <p>
	                    <spring:message code="CompanyUser_RoleAll" />
	                    </p>
	                    <select id="searchRoleId"  name="searchRoleId" style="width:100px">
	                    <option value="" selected = "selected"><spring:message code="CompanyUser_pleaseChoose"/></option>
	                       <c:forEach items="${companyRoleTemp.roleList}" var="company" varStatus="status">
	                       <option value="${company.roleId}" >${company.roleName} </option>
	                       </c:forEach>
	                    </select> 
	                </div>
                
	                <div class="searchInp clearfix">
	                     <p>
	                     <spring:message code="CompanyUser_GroupAll" />
	                     </p>
						 <select id="searchGroupId"  name="searchGroupId" style="width:100px">
						 <option value="" selected = "selected"><spring:message code="CompanyUser_pleaseChoose"/></option>
	                     <c:forEach items="${companyGroupTemp.groupList}" var="company" varStatus="status">
	                       <option value="${company.groupId}" >${company.groupName} </option>
	                     </c:forEach>
						 </select>
	                </div>
                
	                
                
					<div class="searchInp clearfix">
						<!-- 联系电话 -->
	                    <p><spring:message code="CompanyUser_Mobile" /></p>
	                    <input class="w-customer"  id="mobile"  name="mobile" >
	                </div>
				</div>
			
				<div class="searchRight clearfix" id="subItem">
					<!-- 检索 -->
					<button type="button" class="btn-js" onclick="searchListForm();">
						<spring:message code="commom_check" />
					</button>

					<!-- 重置 -->
					<button type="button" class="btn-js" onclick="clean();">
						<spring:message code="common_reset" />
					</button>
						
					<!-- 创建 -->
					<shiro:hasPermission name="companyuser:message:edit">
						<button type="button" class="btn-cj"
							onclick="popup('900px','584px','${ctx}/companyuser/message/form?editFlag=0')">
						<spring:message code="common_create" />
						</button>
					</shiro:hasPermission>
				</div>
			</div>
			
			<div class="tableArea">
				<div class="tableScrollSm" style="overflow: auto;width: 1451px;height: 714px; ">
					<table cellpadding="0" class="tableHead">
						<thead>
							<tr>
								<th><p class="table-No"><spring:message code="common_no" /></p></th>
								<th><p class="width-150px"><spring:message code="CompanyUser_No" /></p></th>
								<th><p class="table-ygxm"><spring:message code="CompanyUser_Name" /></p></th>
								<th><p class="table-xb"><spring:message code="CompanyUser_list_Sex" /></p></th>
								<th><p class="table-csny"><spring:message code="CompanyUser_MobileNo" /></p></th>
								<th><p class="table-email"><spring:message code="CompanyUser_Email" /></p></th>
								<th><p class="table-lxdh"><spring:message code="CompanyUser_Mobile" /></p></th>
								<th><p class="table-ygdzcu"><spring:message code="CompanyUser_Address" /></p></th>
								<th><p class="table-ygjs"><spring:message code="CompanyUser_Role" /></p></th>
							    <th><p class="table-ygzu"><spring:message code="CompanyUser_Duty" /></p></th>
								<th><p class="table-ygzb"><spring:message code="CompanyUser_Group" /></p></th>	
								<th><p class="table-cjz"><spring:message code="CompanyUser_Creater" /></p></th>
								<th><p class="table-rq"><spring:message code="CompanyUser_CreateDate" /></p></th>
							</tr>
						</thead>
					</table>
					
					<table cellpadding="0" class="tableBody"  style ="width:600px" >
						<tbody  id = "listHtml">
						</tbody>
					</table>
				</div>
			</div>
		</div>
		
		<div id = "paging" ></div>
	</form>
</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
	searchListForm();

    $("#searchDutyId").select2();
    $("#searchRoleId").select2();
    $("#searchGroupId").select2();
	});
</script>
</html>